<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="{{ url_for('static',filename='bootstrap.css') }}">
    <link rel="stylesheet" href="{{ url_for('static',filename='body_css.css') }}">
    {% block head %}{% endblock %}
</head>
<body>
<div class="container mt-3">
    <nav class="navbar navbar-expand-lg bg-light">
        <div class="container-fluid">
            <a class="navbar-brand" href="#"><span><img src="/static/lz.png" alt="" style="height: 40px"> Huty摄影作品网</span></a>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">

                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page"
                           href="{{ url_for('question_answer.index') }}">作品展示</a>
                    </li>
                     <li class="nav-item">
                        <a class="nav-link active" aria-current="page"
                           href="{{ url_for('question_answer.picture_show') }}">上传图片</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('question_answer.photo_upload') }}">上传作品</a>
                    </li>
                    <li class="nav-item">
                        <form class="d-flex" role="search" method="get" action="{{ url_for('question_answer.search') }}">
                            <input class="form-control me-2" type="search" placeholder="关键字" aria-label="Search"
                                   name="q">
                            <button class="btn btn-outline-success" type="submit" style="width: 100px">搜索</button>
                        </form>
                    </li>
                </ul>
                <ul class="navbar-nav mb-2 mb-lg-0">
                    {% if user %}
                        <li class="nav-item">
                            <span class="nav-link">{{ user.username }}</span>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ url_for('user.logout') }}">退出登陆</a>
                        </li>
                    {% else %}
                        <li class="nav-item">
                            <a class="nav-link" aria-current="page" href="{{ url_for('user.login') }}">登陆</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ url_for('user.register') }}">注册</a>
                        </li>
                    {% endif %}
                </ul>

            </div>
        </div>
    </nav>
</div>
<div class="container">{% block body %}{% endblock %}</div>
</body>
</html>